Ext.namespace("Doc.Main");

Doc.Main.tabIndex = {
	"totask" : 0,
	"tofeedback2":1,
	"search" : 2
};
Doc.Main.tabs = [];

Doc.initUI = function() {
	var opentab = Utils.getParameter('opentab');
	if (!opentab) opentab = "totask";	
	// init tabs
	Doc.Main.tabs.push(new Doc.ToTask());
	Doc.Main.tabs.push(new Doc.ToFeedback2());
	Doc.Main.tabs.push(new Doc.Search2());
	Doc.instance = new Ext.TabPanel({
		region: 'center',
		activeTab: Doc.Main.tabIndex[opentab],
		items: Doc.Main.tabs
	});
	
	var mainview = new Ext.Viewport({
        layout:'border',
        items:[Doc.instance]
    });
};

Ext.onReady(function(){
	Ext.QuickTips.init();
    Ext.BLANK_IMAGE_URL = '../resources/images/default/s.gif';
	Doc.initUI();
});

